﻿<?php  
 include ("../../language/default_language.php");
 
 # 使用数据库之前要定义的3个函数
 $db_libr   = "pc_install_config";
 $db_table = "config";
 $db_name = "装机配置";
 
 # 载入数据库
 include ("../db_config.php");
 
 # 查询数据库
 $query_config = mysql_query("SELECT * FROM $db_table ");
 
 # 查询行数
 $config_num = mysql_num_rows($query_config);
 
 # 线程开始
 session_start();
  
 if (!$query_config)
 {
    echo'查询失败';
 }
 else if ($config_num > 0)
	 {
	 if ($state == bk /*检测是否为后台*/)
	 {
		 echo '
		 <table class="table table-bordered text-center">
		 <tr>
			 <tr>
			 <td>编辑配置</td>
			 <td>配置类型</td>
			 <td>CPU类型</td>
			 <td>主板</td>
			 <td>CPU</td>
			 <td>内存条</td>
			 <td>显卡</td>
			 <td>硬盘</td>
			 <td>电源</td>
			 <td>机箱条</td>
			 <td>显示器</td>
			 <td>鼠标</td>
			 <td>键盘</td>
			 <td>音响</td>
			 <td>总价</td>
		 </tr>
		 ';
		 while($pc_config_row=mysql_fetch_assoc($query_config))
		 {
		 echo '<tr>';
		 echo '<td><span class="glyphicon glyphicon-edit"></span> </td>';
		 echo "<td>".$pc_config_row['cname']."</td>";
         echo "<td>".$pc_config_row['cpu_type']."</td>";
         echo "<td>".$pc_config_row['main_board']."</td>";
         echo "<td>".$pc_config_row['cpu']."</td>";
		 echo "<td>".$pc_config_row['memory']."</td>";
		 echo "<td>".$pc_config_row['gpu']."</td>";
		 echo "<td>".$pc_config_row['disk']."</td>";
		 echo "<td>".$pc_config_row['power']."</td>";
		 echo "<td>".$pc_config_row['row']."</td>";
		 echo "<td>".$pc_config_row['display']."</td>";
		 echo "<td>".$pc_config_row['mouse']."</td>";
		 echo "<td>".$pc_config_row['keyboard']."</td>";
		 echo "<td>".$pc_config_row['stereo']."</td>";
		 echo "<td>".$pc_config_row['tp']."</td>";
		 echo '</tr>';
		 }
		 echo '</table>';
		 }
		 if ($state == fd /*检测是否为前台*/)
		 {
		   echo '
		 <table class="table table-bordered text-center">
		 <tr>
			 <tr>
			 <td>编辑配置</td>
			 <td>配置类型</td>
			 <td>CPU类型</td>
			 <td>主板</td>
			 <td>CPU</td>
			 <td>内存条</td>
			 <td>显卡</td>
			 <td>硬盘</td>
			 <td>电源</td>
			 <td>机箱条</td>
			 <td>显示器</td>
			 <td>鼠标</td>
			 <td>键盘</td>
			 <td>音响</td>
			 <td>总价</td>
		 </tr>
		 ';
		 while($pc_config_row=mysql_fetch_assoc($query_config))
		 {
		 echo '<tr>';
         echo "<td>".$pc_config_row['cpu_type']."</td>";
         echo "<td>".$pc_config_row['main_board']."</td>";
         echo "<td>".$pc_config_row['cpu']."</td>";
		 echo "<td>".$pc_config_row['memory']."</td>";
		 echo "<td>".$pc_config_row['gpu']."</td>";
		 echo "<td>".$pc_config_row['disk']."</td>";
		 echo "<td>".$pc_config_row['power']."</td>";
		 echo "<td>".$pc_config_row['row']."</td>";
		 echo "<td>".$pc_config_row['display']."</td>";
		 echo "<td>".$pc_config_row['mouse']."</td>";
		 echo "<td>".$pc_config_row['keyboard']."</td>";
		 echo "<td>".$pc_config_row['stereo']."</td>";
		 echo "<td>".$pc_config_row['tp']."</td>";
		 echo '</tr>';
		 }
		 echo '</table>';
		 }
	 }
	 else
	 {
	    echo'<div class="alert alert-danger" role="alert">没有找到配置信息,请检查数据库!</div>';
	 }
	 
 mysql_close($connection);
?>
	